Attribute VB_Name = "Functions"
Public Const GWL_WNDPROC = (-4)

Public Const WM_SETFOCUS = &H7

Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Dim flag As Boolean

Public oldProc As Long
Public Function WndProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    If uMsg = WM_SETFOCUS Then
        WndProc = 0
        Exit Function
    End If
    WndProc = CallWindowProc(oldProc, hwnd, uMsg, wParam, lParam)
End Function
